package com.bayair.doctor.ui.login;


import android.util.ArrayMap;

import com.bayair.doctor.data.bean.IMSignKey;
import com.bayair.doctor.mvp.IModel;
import com.bayair.doctor.data.bean.LoginResp;
import com.bayair.doctor.data.bean.VerityResp;
import com.bayair.doctor.net.BaseEntity;
import com.bayair.doctor.net.RxManager;
import com.bayair.doctor.net.RxSchedulers;

import io.reactivex.Observable;

/**
 * Author: tuyrt7
 * Date: 2019/9/29 9:40
 * Description:
 */
public class LoginModel extends IModel implements LoginContract.Model {

    @Override
    public Observable<BaseEntity<VerityResp>> verity(String phone) {
        ArrayMap<String, String> map = new ArrayMap<>();
        map.put("phone", phone);
        return RxManager.getInstance().getApiService().verity(map);
    }

    @Override
    public Observable<BaseEntity<IMSignKey>> getSignKey(String token) {
        ArrayMap<String, String> map = new ArrayMap<>();
        map.put("token", token);
        return RxManager.getInstance().getApiService().getSignKey(map);
    }

    @Override
    public Observable<BaseEntity<LoginResp>> login(String phone, String verifyCode) {
        ArrayMap<String, String> map = new ArrayMap<>();
        map.put("vcode", verifyCode);
        return RxManager.getInstance().getApiService().login(map);

    }
}
